-- select * from cv_skill
-- delete from cv_skill
INSERT INTO cv_skill
SELECT 
case len(convert(varchar(10),id))
    when 6 then '00000000-0000-0000-0000-000000' + convert(varchar(10),id)
    when 5 then '00000000-0000-0000-0000-0000000' + convert(varchar(10),id) 
    when 4 then '00000000-0000-0000-0000-00000000' + convert(varchar(10),id) 
    when 3 then '00000000-0000-0000-0000-000000000' + convert(varchar(10),id) 
    when 2 then '00000000-0000-0000-0000-0000000000' + convert(varchar(10),id) 
    when 1 then '00000000-0000-0000-0000-00000000000'+ convert(varchar(10),id) 
    end As Id,skillsubject AS [Subject],NULL AS [SkillCode],Skillcontent AS [Body],'00000000-0000-0000-0000-00000' + convert(varchar(7),resumeid) AS  [ResumeId],createddate AS [DateCreated],updateddate AS [LastUpdated]FROM srv_lnk.nchr2008.dbo.ResumeSkill
where resumeid in (select right(id,7) from cv_resume)



-- SELECT TOP 10 * FROM srv_lnk.nchr2008.dbo.ResumeSkill order by id desc